package com.demo.designmode.observer;

/**
 * @Author: jxm
 * @Description: 观察者模式 测试
 * @Date: 2023-12-12 10:45
 * @Version: 1.0
 */
public class Client {

    public static void main(String[] args) {
        //1、创建公众号对象
        SubscriptionSubject subject = new SubscriptionSubject();
        //2、订阅公众号
        subject.attach(new WeixinUser("张三"));
        subject.attach(new WeixinUser("李四"));
        subject.attach(new WeixinUser("王五"));

        //3、公众号更新，发送消息给观察者对象
        subject.notify("消息更新了");
    }
}
